import chalk from "chalk";
import clear from "clear";
import figlet from 'figlet';
import inquirer from 'inquirer';
import ProgressBar from 'progress';
import { Gener } from "./gen/Gener";

function welcome() {
    console.log(
        chalk.blueBright(
            figlet.textSync('tsc-cli', { horizontalLayout: 'full' })
        )
    )
}

function ui() {
    const test = [
        {
            name: 'type',
            type: 'input',
            message: '选择类型'
        }
    ]
    return inquirer.prompt(test);
}
async function showAnswer() {
    // const data = await ui();
    gen();
}

function gen() {
    const gener = new Gener();
    const bar = new ProgressBar('安装进度:[:bar]', { total: 10, width: 50 });
    gener.onStep((step) => {
        bar.tick(step);
        // console.log(`执行到第${step}步`);
    });
    gener.createProject();
}
clear();
welcome();
showAnswer();